<?
namespace Admin\Controller
{
    /**
     * Medoty do aktualizowania backendu               
     *
     */
    class EventCall extends \Api\Controller
    {
        public function indexAction(array $param = array()){
           \Api\Redirect::CreateRedirect('admin','index','index');
        }
        
        /**
         * Metoda aktualizuje dane zawarte w pliku htaccess
         * w oparciu o wpiswy z tabeli `htaccess` w db
         */
        public function htaccessAction(array $param = array())
        {
            if(\Api\Model\Login::IsValid() && \Api\Model\Login::GetPrivilages() == 1)
            {
                $htaccess = new \Api\Htaccess($this->m_config);
                $htaccess->Overwrite(BASE_PATH.'/.htaccess');
                            
            }else
            {
                throw new \Exception("EVENTCALL: Invalid user privilages");
            }
            $this->layout = null;
        }
    }
}
?>